import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import pipeline.Pipeline;


public class PipelineStarter {

	public void startPipeline(String pipeLineProbertyFile){
		try {
			BeanFactory factory = new ClassPathXmlApplicationContext(pipeLineProbertyFile);
			
			Pipeline pipeline = (Pipeline)factory.getBean("ImageProcessingPipeline");
			
			pipeline.start(pipeLineProbertyFile);
			
		} catch (BeansException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		PipelineStarter ps= new PipelineStarter();
		ps.startPipeline("pipeline.xml");
	}

}
